class BlindBoxOrderDetailVo {

  BlindBoxOrderDetailData? data;

  BlindBoxOrderDetailVo({this.data});

  BlindBoxOrderDetailVo.fromJson(Map<String, dynamic> json) {
    data = json['data'] != null ? new BlindBoxOrderDetailData.fromJson(json['data']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) {
      data['data'] = this.data!.toJson();
    }
    return data;
  }
}

class BlindBoxOrderDetailData {
  int? id;
  String? orderSn;
  int? payStatus;
  int? teamId;
  int? status;
  String? statusStr;
  int? source;
  String? payableAmount;
  String? paidAmount;
  String? totalAmount;
  String? createdAt;
  String? updatedAt;
  int? remainingTime;
  String? trackingNumber;
  String? companyCode;
  String? companyTitle;
  int? isLottery;
  int? isCheck;
  int? shippingStatus;
  List<Packages>? packages;
  List<Costs>? costs;
  Lottery? lottery;
  String? voucherCode;
  String? writeoffUrl;
  List<Transfer>? transfer;
  int? type;

  BlindBoxOrderDetailData(
      {this.id,
      this.orderSn,
      this.payStatus,
      this.teamId,
      this.status,
      this.statusStr,
      this.source,
      this.payableAmount,
      this.paidAmount,
      this.totalAmount,
      this.createdAt,
      this.updatedAt,
      this.remainingTime,
      this.trackingNumber,
      this.companyCode,
      this.companyTitle,
      this.isLottery,
      this.isCheck,
      this.shippingStatus,
      this.packages,
      this.costs,
      this.lottery,
      this.voucherCode,
      this.writeoffUrl,
      this.transfer,
      this.type});

  BlindBoxOrderDetailData.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    orderSn = json['order_sn'];
    payStatus = json['pay_status'];
    teamId = json['team_id'];
    status = json['status'];
    statusStr = json['status_str'];
    source = json['source'];
    payableAmount = json['payable_amount'];
    paidAmount = json['paid_amount'];
    totalAmount = json['total_amount'];
    createdAt = json['created_at'];
    updatedAt = json['updated_at'];
    remainingTime = json['remaining_time'];
    trackingNumber = json['tracking_number'];
    companyCode = json['company_code'];
    companyTitle = json['company_title'];
    isLottery = json['is_lottery'];
    isCheck = json['is_check'];
    shippingStatus = json['shipping_status'];
    voucherCode = json['voucher_code'];
    writeoffUrl = json['writeoff_url'];
    type = json['type'];
    if (json['packages'] != null) {
      packages = <Packages>[];
      json['packages'].forEach((v) {
        packages!.add(new Packages.fromJson(v));
      });
    }
    if (json['costs'] != null) {
      costs = <Costs>[];
      json['costs'].forEach((v) {
        costs!.add(new Costs.fromJson(v));
      });
    }
    lottery =
        json['lottery'] != null ? new Lottery.fromJson(json['lottery']) : null;

    if (json['transfer'] != null) {
      transfer = <Transfer>[];
      json['transfer'].forEach((v) {
        transfer!.add(new Transfer.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['order_sn'] = this.orderSn;
    data['pay_status'] = this.payStatus;
    data['team_id'] = this.teamId;
    data['status'] = this.status;
    data['status_str'] = this.statusStr;
    data['source'] = this.source;
    data['payable_amount'] = this.payableAmount;
    data['paid_amount'] = this.paidAmount;
    data['total_amount'] = this.totalAmount;
    data['created_at'] = this.createdAt;
    data['updated_at'] = this.updatedAt;
    data['remaining_time'] = this.remainingTime;
    data['tracking_number'] = this.trackingNumber;
    data['company_code'] = this.companyCode;
    data['company_title'] = this.companyTitle;
    data['is_lottery'] = this.isLottery;
    data['is_check'] = this.isCheck;
    data['shipping_status'] = this.shippingStatus;
    data['voucher_code'] = this.voucherCode;
    data['writeoff_url'] = this.writeoffUrl;
    data['type'] = this.type;
    if (this.packages != null) {
      data['packages'] = this.packages!.map((v) => v.toJson()).toList();
    }
    if (this.costs != null) {
      data['costs'] = this.costs!.map((v) => v.toJson()).toList();
    }
    if (this.lottery != null) {
      data['lottery'] = this.lottery!.toJson();
    }
    if (this.transfer != null) {
      data['transfer'] = this.transfer!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Packages {
  int? orderId;
  String? title;
  String? image;
  String? price;
  int? quantity;

  Packages({this.orderId, this.title, this.image, this.price, this.quantity});

  Packages.fromJson(Map<String, dynamic> json) {
    orderId = json['order_id'];
    title = json['title'];
    image = json['image'];
    price = json['price'];
    quantity = json['quantity'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['order_id'] = this.orderId;
    data['title'] = this.title;
    data['image'] = this.image;
    data['price'] = this.price;
    data['quantity'] = this.quantity;
    return data;
  }
}

class Costs {
  String? key;
  String? label;
  String? value;
  String? color;

  Costs({this.key, this.label, this.value});

  Costs.fromJson(Map<String, dynamic> json) {
    key = json['key'];
    label = json['label'];
    value = json['value'];
    color = json['color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['key'] = this.key;
    data['label'] = this.label;
    data['value'] = this.value;
    data['color'] = this.color;
    return data;
  }
}

class Lottery {
  int? packageId;
  int? productId;
  int? status;
  Product? product;

  Lottery({this.packageId, this.productId, this.status, this.product});

  Lottery.fromJson(Map<String, dynamic> json) {
    packageId = json['package_id'];
    productId = json['product_id'];
    status = json['status'];
    product =
        json['product'] != null ? new Product.fromJson(json['product']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['package_id'] = this.packageId;
    data['product_id'] = this.productId;
    data['status'] = this.status;
    if (this.product != null) {
      data['product'] = this.product!.toJson();
    }
    return data;
  }
}

class Product {
  String? image;
  String? title;
  int? type;

  Product({this.image, this.title, this.type});

  Product.fromJson(Map<String, dynamic> json) {
    image = json['image'];
    title = json['title'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['image'] = this.image;
    data['title'] = this.title;
    data['type'] = this.type;
    return data;
  }
}

class Transfer {
  String? key;
  String? label;
  String? value;

  Transfer({this.key, this.label, this.value});

  Transfer.fromJson(Map<String, dynamic> json) {
    key = json['key'];
    label = json['label'];
    value = json['value'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['key'] = this.key;
    data['label'] = this.label;
    data['value'] = this.value;
    return data;
  }
}